package dkbta.ontology.elements.stat;

import java.sql.PreparedStatement;
import java.sql.SQLException;

import dkbta.ontology.elements.Element;
import dkbta.ontology.elements.ElementType;
import dkbta.util.time.TimeInterval;

public class Stat extends Element{

	/**
	 * Initializes a statistical abstraction instance with the given parameters
	 * 
	 * @param name The statistical abstraction's name
	 * @param startTime The statistical abstraction's start time
	 * @param endTime The statistical abstraction's end time
	 */
	public Stat(String name, long startTime, long endTime){
		super(ElementType.STAT, name, startTime, endTime, null, null);
	}

	/**
	 * Initializes a statistical abstraction instance with the given parameters
	 * 
	 * @param name The statistical abstraction's name
	 * @param timeInterval The statistical abstraction's time interval
	 */
	public Stat(String name, TimeInterval timeInterval){
		super(ElementType.STAT, name, timeInterval, null, null);
	}

	@Override
	public void insertDataIntoPS(PreparedStatement ps, int valueIndex, int typeIndex)
			throws SQLException{
		ps.setString(valueIndex, "true");
		ps.setString(typeIndex, "STAT");
	}

}
